package com.gdpa.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gdpa.entity.BrokerBuildingWithAreaName;
import com.gdpa.entity.BrokerHouse;
import com.gdpa.entity.BrokerHouseWithName;
import com.gdpa.mapper.BrokerHouseMapper;
import com.gdpa.service.IBrokerHouseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 经纪房源表 服务实现类
 * </p>
 *
 * @author zsr
 * @since 2018-12-19
 */
@Service
public class BrokerHouseServiceImpl extends ServiceImpl<BrokerHouseMapper, BrokerHouse> implements IBrokerHouseService {
    @Autowired
    BrokerHouseMapper brokerHouseMapper;

    @Override
    public List<BrokerHouse> getHouse(Page page) {
        return brokerHouseMapper.getHouse(page);
    }

    @Override
    public boolean deleteById(Integer id) {
        return brokerHouseMapper.deleteById(id);
    }

    @Override
    public boolean add(BrokerHouseWithName brokerHouseWithName) {
        return brokerHouseMapper.add(brokerHouseWithName);
    }

    @Override
    public boolean update(BrokerHouseWithName brokerHouseWithName) {
        return brokerHouseMapper.update(brokerHouseWithName);
    }

    @Override
    public List<BrokerHouseWithName> find(Page page,Integer id, Integer price, Integer state) {
        return brokerHouseMapper.find(page,id,price,state);
    }

    @Override
    public String getBuildingName(Integer id) {
        return brokerHouseMapper.getBuildingName(id);
    }

    @Override
    public String getUserName(Integer id) {
        return brokerHouseMapper.getUserName(id);
    }
}
